<?php ob_start() ?>

<div class="row">
    <div class="col-lg-12">
        <h1>Inicio <small>Resumen</small></h1>
    </div>
</div>
<hr>
<div class="row">
    <div class="col-lg-4">
        <div class="panel panel-warning">
            <div class="panel-heading">
                <div class="row">
                    <div class="col-xs-6">
                        <i class="fa fa-suitcase fa-5x"></i>
                    </div>
                    <div class="col-xs-6 text-right">
                        <p class="announcement-heading"><?php foreach ($num_comerciales as $fila) {
    echo $fila['numero'];
} ?></p>
                        <p class="announcement-text">Comerciales</p>
                    </div>
                </div>
            </div>
            <a href="listado_comerciales">
                <div class="panel-footer announcement-bottom">
                    <div class="row">
                        <div class="col-xs-6">
                            Ver Comerciales
                        </div>
                        <div class="col-xs-6 text-right">
                            <i class="fa fa-arrow-circle-right"></i>
                        </div>
                    </div>
                </div>
            </a>
        </div>
    </div>
    <div class="col-lg-4">
        <div class="panel panel-info">
            <div class="panel-heading">
                <div class="row">
                    <div class="col-xs-6">
                        <i class="fa fa-users fa-5x"></i>
                    </div>
                    <div class="col-xs-6 text-right">
                        <p class="announcement-heading"><?php foreach ($num_clientes as $fila) {
    echo $fila['numero'];
} ?></p>
                        <p class="announcement-text">Clientes</p>
                    </div>
                </div>
            </div>
            <a href="listado_clientes">
                <div class="panel-footer announcement-bottom">
                    <div class="row">
                        <div class="col-xs-6">
                            Ver Clientes
                        </div>
                        <div class="col-xs-6 text-right">
                            <i class="fa fa-arrow-circle-right"></i>
                        </div>
                    </div>
                </div>
            </a>
        </div>
    </div>
    <div class="col-lg-4">
        <div class="panel panel-success">
            <div class="panel-heading">
                <div class="row">
                    <div class="col-xs-6">
                        <i class="fa fa-tasks fa-5x"></i>
                    </div>
                    <div class="col-xs-6 text-right">
                        <p class="announcement-heading"><?php foreach ($num_anuncios as $fila) {
    echo $fila['numero'];
} ?></p>
                        <p class="announcement-text">Anuncios</p>
                    </div>
                </div>
            </div>
            <a href="listado_anuncios">
                <div class="panel-footer announcement-bottom">
                    <div class="row">
                        <div class="col-xs-6">
                            Ver Anuncios
                        </div>
                        <div class="col-xs-6 text-right">
                            <i class="fa fa-arrow-circle-right"></i>
                        </div>
                    </div>
                </div>
            </a>
        </div>
    </div>
</div>
<div class="row">
    <div class="col-lg-12">
        <div class="panel panel-primary">
            <div class="panel-heading">
                <h3 class="panel-title"><i class="fa fa-suitcase"></i> Ultimos comerciales</h3>
            </div>
            <div class="panel-body">
                <div class="table-responsive">
                    <table class="table table-bordered table-hover table-striped tablesorter">
                        <thead>
                            <tr>
                                <th>Nombre <i class="fa fa-sort"></i></th>
                                <th>Apellidos <i class="fa fa-sort"></i></th>
                                <th>Email <i class="fa fa-sort"></i></th>
                                <th>Teléfono <i class="fa fa-sort"></i></th>
                            </tr>
                        </thead>
                        <tbody>
<?php foreach ($params_comerciales as $fila) { ?>
                           
                                <tr onclick="location = 'ver_comercial/<?php echo $fila['id'] ?>'" style="cursor: pointer">
                                    <td><?php echo $fila['nombre'] ?></td>
                                    <td><?php echo $fila['apellidos'] ?></td>
                                    <td><?php echo $fila['email'] ?></td>
                                    <td><?php echo $fila['telefono'] ?></td>
                                </tr>
                            
<?php } ?>
                        </tbody>
                    </table>
                </div>
                <div class="text-right">
                    <a href="listado_comerciales">Ver todos los comerciales <i class="fa fa-arrow-circle-right"></i></a>
                </div>
            </div>
        </div>
    </div>
    <div class="col-lg-12">
        <div class="panel panel-primary">
            <div class="panel-heading">
                <h3 class="panel-title"><i class="fa fa-users"></i> Ultimos clientes</h3>
            </div>
            <div class="panel-body">
                <div class="table-responsive">
                    <table class="table table-bordered table-hover table-striped tablesorter">
                        <thead>
                            <tr>
                                <th>Nombre <i class="fa fa-sort"></i></th>
                                <th>Apellidos <i class="fa fa-sort"></i></th>
                                <th>Email <i class="fa fa-sort"></i></th>
                                <th>Teléfono <i class="fa fa-sort"></i></th>
                            </tr>
                        </thead>
                        <tbody>
<?php foreach ($params_clientes as $fila) { ?>
                                <tr onclick="location = 'ver_cliente/<?php echo $fila['id'] ?>'" style="cursor: pointer">
                                    <td><?php echo $fila['nombre'] ?></td>
                                    <td><?php echo $fila['apellidos'] ?></td>
                                    <td><?php echo $fila['email'] ?></td>
                                    <td><?php echo $fila['telefono'] ?></td>
                                </tr>
<?php } ?>
                        </tbody>
                    </table>
                </div>
                <div class="text-right">
                    <a href="listado_clientes">Ver todos los clientes <i class="fa fa-arrow-circle-right"></i></a>
                </div>
            </div>
        </div>
    </div>
    <div class="col-lg-12">
        <div class="panel panel-primary">
            <div class="panel-heading">
                <h3 class="panel-title"><i class="fa fa-edit"></i> Ultimos Anuncios</h3>
            </div>
            <div class="panel-body">
                <div class="table-responsive">
                    <table class="table table-bordered table-hover table-striped tablesorter">
                        <thead>
                            <tr>
                                <th>Nombre <i class="fa fa-sort"></i></th>
                                <th>Descripción <i class="fa fa-sort"></i></th>
                                <th>Impresiones <i class="fa fa-sort"></i></th>
                                <th>Cliente <i class="fa fa-sort"></i></th>
                                <th>Tarifa <i class="fa fa-sort"></i></th>
                            </tr>
                        </thead>
                        <tbody>
<?php foreach ($params_anuncios as $fila) { ?>
                                <tr onclick="location = 'ver_anuncio/<?php echo $fila['id'] ?>'" style="cursor: pointer">
                                    <td><?php echo $fila['nombre'] ?></td>
                                    <td><?php echo substr($fila['descripcion'], 0, 30) ?> ...</td>
                                    <td><?php echo $fila['impresiones'] ?></td>
                                    <td><?php echo $fila['clientenombre'] ?></td>
                                    <td><?php echo $fila['tarifanombre'] ?></td>
                                </tr>
<?php } ?>
                        </tbody>
                    </table>
                </div>
                <div class="text-right">
                    <a href="listado_anuncios">Ver todos los anuncios <i class="fa fa-arrow-circle-right"></i></a>
                </div>
            </div>
        </div>
    </div>
</div>

<?php
$contenido = ob_get_clean();
include 'app/templates/template_administrador.php';
?>